#include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> pii;

void solve() {
    string s;
    cin >> s;
    int ans = s.size();
    for(int i = 0; i < s.size(); i++) {
        if(s[i] == s[i + 1] && s[i] == '0') {
            ans--;
            i++;
        } 
    }
    cout << ans << endl;
}

int main() {
    solve();
    return 0;
}